import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:sptapp/basic/base_info.dart';
import 'package:sptapp/config/const.dart';
import 'package:sptapp/moudle/message.dart';
import 'package:sptapp/page/login/login.dart';
import 'package:sptapp/widget/common_widget.dart';

class MinSetPage extends StatefulWidget {
  const MinSetPage({super.key});

  @override
  State<MinSetPage> createState() => _MinSetPageState();
}

class _MinSetPageState extends State<MinSetPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: defaultBgColor,
      appBar: myAppBar(context, min_set_page_title.tr),
      body: Container(
        padding: EdgeInsets.symmetric(horizontal: 30.w),
        child: SingleChildScrollView(
          child: Column(
            children: [
              SizedBox(height: 30.w),
              Container(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Container(
                      child: Text(min_set_page_item_version.tr),
                    ),
                    Row(
                      children: [
                        Container(
                          height: 30.w,
                          width: 30.w,
                        ),
                        Container(
                          child: Text('v0.1'),
                        ),
                        // Icon(Icons.arrow_forward_ios_rounded,size: 30.w,)
                      ],
                    )
                  ],
                ),
              ),
              SizedBox(height: 40.w),
              GestureDetector(
                onTap: (){
                  Navigator.of(context).pushNamed('ForgetPwd').then((val){
                  });
                },
                child: Container(
                  color: Colors.transparent,
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Container(
                        child: Text(min_set_page_set_pwd_text.tr),
                      ),
                      Row(
                        children: [
                          Container(
                            height: 30.w,
                            width: 30.w,
                          ),
                          Icon(Icons.arrow_forward_ios_rounded,size: 30.w,)
                        ],
                      )
                    ],
                  ),
                ),
              ),
              SizedBox(height: 40.w),
              GestureDetector(
                onTap: (){
                  LocalBaseInfo.clearInfo();
                  Navigator.pushAndRemoveUntil(context, PageRouteBuilder(
                      settings: const RouteSettings(name: "login"),
                      pageBuilder:
                          (BuildContext context, Animation animation,
                          Animation secondaryAnimation) {
                        return const LoginPage();
                      }), (route) => false);
                },
                child: Container(
                  width: 690.w,
                  height: 100.w,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: themeColor,
                    borderRadius: BorderRadius.circular(100.w)
                  ),
                  child: Text(min_set_page_log_out.tr,style: TextStyle(
                    color: fontColor,
                    fontSize: 30.sp,
                    fontWeight: FontWeight.w600
                  ),),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
